package com.killer.texreader.util;

import android.app.Activity;
import android.os.Environment;

/**
 * Created by killer on 2016/4/21.
 */
public class Globals {
    public static int SCREEN_WIDTH;
    public static int SCREEN_HEIGHT;
    //每行显示多少个文字
    public static int LINE_CHAR_COUNT=20;
    //字符间距
    public static int CHAR_SEP = 2;
    //页边距
    public static int PAGE_SEP=20;
    //行间距
    public static int LINE_SEP=2;
    //字符大小
    public static int CHAR_SIZE;
    //每页显示多少行
    public static int LINE_COUNT;


    public static String fullPath;
            //= Environment.getExternalStorageDirectory().getAbsolutePath()+"/zengguofanletter.txt";

    public static DBUtil util;
    public final static  String END_FLAG = "LINE_END_FLAG";
    public static void init(Activity activity){

        util = new DBUtil(activity);

        SCREEN_WIDTH = activity.getWindowManager().getDefaultDisplay().getWidth();
        SCREEN_HEIGHT = activity.getWindowManager().getDefaultDisplay().getHeight();

        CHAR_SIZE = (SCREEN_WIDTH - PAGE_SEP*2-(LINE_CHAR_COUNT-1)*CHAR_SEP)/LINE_CHAR_COUNT;
        LINE_COUNT = SCREEN_HEIGHT*4/5/(CHAR_SIZE+LINE_SEP);
    }


}
